package hcn.protocol.brandnew.zhenliao.shouma;

import com.fasterxml.jackson.annotation.JsonFormat;
import ctd.util.xml.jaxb.DateAdapter;
import ctd.util.xml.jaxb.DateTimeAdapter;
import lombok.Data;
import org.atag.sysrouter.annotation.DictionaryMapping;

import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Date;
import java.util.List;


/**
 * 手术记录信息查询-响应消息（成功） - ODS_03080045_SUC
 *
 * @author enjoyLife
 */
@Data
@XmlRootElement(name = "Data")
@XmlAccessorType(XmlAccessType.FIELD)
public class QueryOperationRecordResponse {

    /**
     * 数量
     */
    @XmlElement(name = "Total")
    private String total;
    /**
     * 手术记录
     */
    @XmlElementWrapper(name = "Records")
    @XmlElement(name = "Record")
    private List<Record> records;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Record {

        /**
         * 就诊医疗机构组织机构代码
         */
        @XmlElement(name = "VisitOrganization")
        private String visitOrganization;
        /**
         * 就诊机构名称
         */
        @XmlElement(name = "VisitOrganizationName")
        private String visitOrganizationName;
        /**
         * 就诊标识
         */
        @XmlElement(name = "VisitId")
        private String visitId;
        /**
         * 住院号码
         */
        @XmlElement(name = "HospizationId")
        private String hospizationId;
        /**
         * 患者姓名
         */
        @XmlElement(name = "Name")
        private String name;
        /**
         * 性别代码
         */
        @XmlElement(name = "Sex")
        private String sex;
        /**
         * 年龄（岁）
         */
        @XmlElement(name = "Age")
        private Short age;
        /**
         * 业务系统患者档案ID
         */
        @XmlElement(name = "SourcePatientId")
        private String sourcePatientId;
        /**
         * 身份证件号码
         */
        @XmlElement(name = "IdCard")
        private String idCard;
        /**
         * 身份证件类别代码
         */
        @XmlElement(name = "IdCardCode")
        @DictionaryMapping(id = "CV02_01_101")
        private String idCardCode;
        /**
         * 出生日期
         */
        @XmlElement(name = "BirthDate")
        @XmlJavaTypeAdapter(DateAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
        private Date birthDate;
        /**
         * 操作类型
         */
        @XmlElement(name = "OperationType")
        private String operationType;
        /**
         * 患者电话号码
         */
        @XmlElement(name = "ContactNo")
        private String contactNo;
        /**
         * 就诊卡类别代码
         */
        @XmlElement(name = "MedicalCardType")
        private String medicalCardType;
        /**
         * 就诊卡号
         */
        @XmlElement(name = "MedicalCardId")
        private String medicalCardId;
        /**
         * 手术记录单编号
         */
        @XmlElement(name = "OperationSourceId")
        private String operationSourceId;
        /**
         * 手术及操作编码
         */
        @XmlElement(name = "OperationCode")
        private String operationCode;
        /**
         * 手术开始时间
         */
        @XmlElement(name = "OperationBeginTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date operationBeginTime;
        /**
         * 手术结束时间
         */
        @XmlElement(name = "OperationEndTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date operationEndTime;
        /**
         * 手术及操作名称
         */
        @XmlElement(name = "OperationName")
        private String operationName;
        /**
         * 科室代码
         */
        @XmlElement(name = "DeptCode")
        private String deptCode;
        /**
         * 病人科室名称
         */
        @XmlElement(name = "DeptName")
        private String deptName;
        /**
         * 麻醉方法代码
         */
        @XmlElement(name = "AnesthesiaWayCode")
        private String anesthesiaWayCode;
        /**
         * 麻醉方法名称
         */
        @XmlElement(name = "AnesthesiaWayName")
        private String anesthesiaWayName;
        /**
         * 术前诊断编码
         */
        @XmlElement(name = "PreoperativeDiagnosisCode")
        private String preoperativeDiagnosisCode;
        /**
         * 术前诊断名称
         */
        @XmlElement(name = "PreoperativeDiagnosis")
        private String preoperativeDiagnosis;
        /**
         * 术后诊断编码
         */
        @XmlElement(name = "PostoperativeDiagnosisCode")
        private String postoperativeDiagnosisCode;
        /**
         * 术后诊断名称
         */
        @XmlElement(name = "PostoperativeDiagnosis")
        private String postoperativeDiagnosis;
        /**
         * 手术等级
         */
        @XmlElement(name = "OperationLevel")
        private Short operationLevel;
        /**
         * 切口等级
         */
        @XmlElement(name = "OperationIncisionDescription")
        private Short operationIncisionDescription;
        /**
         * 切口愈合等级
         */
        @XmlElement(name = "OperationIncisionHealLevel")
        private Short operationIncisionHealLevel;
    }

}
